﻿Imports System
Imports System.Runtime.InteropServices
Imports System.IO.Ports
Imports System.Threading
Imports System.IO


Public Class Form2
    Private _title As String
    Private _unit As String
    Private _detail As String

    Public Property title() As String
        Get
            Return _title
        End Get
        Set(ByVal value As String)
            _title = value
            Label1.Text = value
        End Set
    End Property

    Public Property unit() As String
        Get
            Return _unit
        End Get
        Set(ByVal value As String)
            _unit = value
            Label2.Text = value
        End Set
    End Property

    Public Property detail() As String
        Get
            Return _detail
        End Get
        Set(ByVal value As String)
            _detail = value
            Label3.Text = value
        End Set
    End Property

    Private Sub Form2_Deactivate(sender As Object, e As EventArgs)
        Me.Close()
    End Sub

    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim pop As Point = MousePosition
        pop.X = pop.X - 20
        pop.Y = pop.Y - 20
        Me.Location = pop


        Dim ctl As Control = Me.GetNextControl(Me, True) 'Get the first control in the tab order.
        Do Until ctl Is Nothing
            AddHandler ctl.MouseDown, AddressOf Form2_MouseDown
            ctl = Me.GetNextControl(ctl, True) 'Get the next control in the tab order.
        Loop
        AddHandler Me.Deactivate, AddressOf Form2_Deactivate
    End Sub

    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Close()
    End Sub


    Private Sub Form2_MouseDown(sender As Object, e As MouseEventArgs)
        Me.Close()
    End Sub

End Class